﻿Public Class Form1
    Public hosts_loc = "C:\Windows\system32\drivers\etc\hosts"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Function WriteHosts(ByVal ip As String)
        If IO.File.Exists(hosts_loc) Then
            IO.File.Delete(hosts_loc)
            Dim i As IO.StreamWriter
            i = IO.File.AppendText(hosts_loc)
            i.WriteLine("# Copyright (c) 1993-2009 Microsoft Corp.")
            i.WriteLine("# Written by L2.NET Connector - l2connector.codeplex.com for more...")
            i.WriteLine("#")
            i.WriteLine("# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.")
            i.WriteLine("#")
            i.WriteLine("# This file contains the mappings of IP addresses to host names. Each")
            i.WriteLine("# entry should be kept on an individual line. The IP address should")
            i.WriteLine("# be placed in the first column followed by the corresponding host name.")
            i.WriteLine("# The IP address and the host name should be separated by at least one")
            i.WriteLine("# space.")
            i.WriteLine("#")
            i.WriteLine("# Additionally, comments (such as these) may be inserted on individual")
            i.WriteLine("# lines or following the machine name denoted by a '#' symbol.")
            i.WriteLine("#")
            i.WriteLine("# For example:")
            i.WriteLine("#")
            i.WriteLine("#      102.54.94.97     rhino.acme.com          # source server")
            i.WriteLine("#       38.25.63.10     x.acme.com              # x client host")
            i.WriteLine("")
            i.WriteLine("# localhost name resolution is handled within DNS itself.")
            i.WriteLine("# Written by L2.NET Connector - l2connector.codeplex.com for more...")
            i.WriteLine("")
            i.WriteLine("127.0.0.1  localhost")
            i.WriteLine(ip & " L2authd.lineage2.com")
            i.WriteLine("91.185.193.200 nProtect.lineage2.com")
        Else
            Dim i As IO.StreamWriter
            i = IO.File.AppendText(hosts_loc)
            i.WriteLine("# Copyright (c) 1993-2009 Microsoft Corp.")
            i.WriteLine("# Written by L2.NET Connector - l2connector.codeplex.com for more...")
            i.WriteLine("#")
            i.WriteLine("# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.")
            i.WriteLine("#")
            i.WriteLine("# This file contains the mappings of IP addresses to host names. Each")
            i.WriteLine("# entry should be kept on an individual line. The IP address should")
            i.WriteLine("# be placed in the first column followed by the corresponding host name.")
            i.WriteLine("# The IP address and the host name should be separated by at least one")
            i.WriteLine("# space.")
            i.WriteLine("#")
            i.WriteLine("# Additionally, comments (such as these) may be inserted on individual")
            i.WriteLine("# lines or following the machine name denoted by a '#' symbol.")
            i.WriteLine("#")
            i.WriteLine("# For example:")
            i.WriteLine("#")
            i.WriteLine("#      102.54.94.97     rhino.acme.com          # source server")
            i.WriteLine("#       38.25.63.10     x.acme.com              # x client host")
            i.WriteLine("")
            i.WriteLine("# localhost name resolution is handled within DNS itself.")
            i.WriteLine("# Written by L2.NET Connector - l2connector.codeplex.com for more...")
            i.WriteLine("")
            i.WriteLine("127.0.0.1  localhost")
            i.WriteLine(ip & " L2authd.lineage2.com")
            i.WriteLine("91.185.193.200 nProtect.lineage2.com")
        End If
    End Function

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Close()
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        If ComboBox1.Text = "L2Addicts" Then
            iptext.Text = "62.231.97.137"
        ElseIf ComboBox1.Text = "L2Daywalker" Then
            iptext.Text = "70.36.98.10"
        ElseIf ComboBox1.Text = "L2Iluna" Then
            iptext.Text = "94.23.42.127"
        ElseIf ComboBox1.Text = "L2Viciousrage" Then
            iptext.Text = "94.229.70.209"
        ElseIf ComboBox1.Text = "L2Deathwhisper" Then
            iptext.Text = "89.163.145.9"
        ElseIf ComboBox1.Text = "L2Raidfight" Then
            iptext.Text = "188.40.71.172"
        ElseIf ComboBox1.Text = "L2Maxcheaters" Then
            iptext.Text = "89.163.145.69"
        ElseIf ComboBox1.Text = "L2Excavate" Then
            iptext.Text = "64.20.33.226"
        ElseIf ComboBox1.Text = "L2Eternalfight" Then
            iptext.Text = "85.25.184.74"
        ElseIf ComboBox1.Text = "L2Xtacy" Then
            iptext.Text = "85.25.184.178"
        ElseIf ComboBox1.Text = "L2Inc" Then
            iptext.Text = "85.25.73.109"
        ElseIf ComboBox1.Text = "L2Cerberus" Then
            iptext.Text = "64.27.20.162"
        ElseIf ComboBox1.Text = "L2Inmortalhero" Then
            iptext.Text = "91.121.86.27"
        ElseIf ComboBox1.Text = "" Then
            iptext.Text = ""
        Else
            iptext.Text = ""
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WriteHosts(iptext.Text)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MsgBox("Created by Stealth.")
    End Sub

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        Process.Start(LinkLabel1.Text)
    End Sub
End Class
